docs(query): use the v5 filters-object form in QueryCache examples#10873
docs(query): use the v5 filters-object form in QueryCache examples#10873DucMinhNe wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughDocumentation examples for ChangesQueryCache API documentation updates
🎯 1 (Trivial) | ⏱️ ~2 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
docs/reference/QueryCache.md (2)
60-60: ⚡ Quick winDocumentation inconsistency:
filtersparameter is required, not optional.The documented signature shows
filters?: QueryFilters, but the actual implementation requires thefiltersparameter with a mandatoryqueryKeyproperty:find(filters: WithRequired<QueryFilters, 'queryKey'>).This is a pre-existing issue not introduced by this PR, but should be corrected for accuracy.
📝 Suggested documentation fix
-- `filters?: QueryFilters`: [Query Filters](../framework/react/guides/filters#query-filters) +- `filters: QueryFilters`: [Query Filters](../framework/react/guides/filters#query-filters) + - `queryKey` is required within the filters object🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/reference/QueryCache.md` at line 60, Update the documentation to match the implementation: change the `filters?: QueryFilters` entry to indicate `filters` is required and must include a `queryKey` (e.g., reflect the implementation signature `find(filters: WithRequired<QueryFilters, 'queryKey'>)`). Ensure the docs for QueryCache (the `filters` parameter) mention that `queryKey` is mandatory and describe its expected shape or link to the QueryFilters type. Keep wording minimal and precise so callers know `filters` is not optional and must contain `queryKey`.
79-80: ⚡ Quick winDocumentation format could be clearer about the single filters parameter.
The current format lists
queryKeyandfiltersas if they are separate parameters, butfindAllactually accepts a singlefiltersparameter wherequeryKeyis an optional property of that object.This is a pre-existing issue not introduced by this PR, but could be clarified to avoid confusion.
📝 Suggested documentation fix
**Options** -- `queryKey?: QueryKey`: [Query Keys](../framework/react/guides/query-keys.md) -- `filters?: QueryFilters`: [Query Filters](../framework/react/guides/filters.md#query-filters) +- `filters?: QueryFilters`: [Query Filters](../framework/react/guides/filters.md#query-filters) + - `queryKey?: QueryKey`: [Query Keys](../framework/react/guides/query-keys.md) - Optional query key to filter by + - Plus other filter options as documented in Query Filters🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/reference/QueryCache.md` around lines 79 - 80, Update the docs to clarify that the findAll API accepts a single "filters" object parameter (type QueryFilters) which may include an optional queryKey property, rather than two separate parameters; change the parameter list to show a single entry like "filters?: QueryFilters (where filters.queryKey?: QueryKey)" and update the links to point to the QueryFilters and Query Keys docs so readers understand queryKey is a property on the filters object (refer to the findAll function and the QueryFilters and QueryKey types to ensure accurate wording).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@docs/reference/QueryCache.md`:
- Line 60: Update the documentation to match the implementation: change the
`filters?: QueryFilters` entry to indicate `filters` is required and must
include a `queryKey` (e.g., reflect the implementation signature `find(filters:
WithRequired<QueryFilters, 'queryKey'>)`). Ensure the docs for QueryCache (the
`filters` parameter) mention that `queryKey` is mandatory and describe its
expected shape or link to the QueryFilters type. Keep wording minimal and
precise so callers know `filters` is not optional and must contain `queryKey`.
- Around line 79-80: Update the docs to clarify that the findAll API accepts a
single "filters" object parameter (type QueryFilters) which may include an
optional queryKey property, rather than two separate parameters; change the
parameter list to show a single entry like "filters?: QueryFilters (where
filters.queryKey?: QueryKey)" and update the links to point to the QueryFilters
and Query Keys docs so readers understand queryKey is a property on the filters
object (refer to the findAll function and the QueryFilters and QueryKey types to
ensure accurate wording).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d5c91d78-d917-4ac4-b1b7-ff3c04b0eb1d
📒 Files selected for processing (1)
docs/reference/QueryCache.md
|
View your CI Pipeline Execution ↗ for commit 98b4c28
☁️ Nx Cloud last updated this comment at |
Description
The
QueryCachereference examples callfind/findAllwith a positional query key — the v4 signature. In v5, both take a single filters object, which is what this page's own Options already document (filters?: QueryFilters). The examples are therefore out of date and won't type-check / behave as shown on v5.Updated the three examples to the v5 form:
Docs-only; brings the examples in line with the v5 API and the Options already listed on the page.
Summary by CodeRabbit